import java.util.Scanner;

public class maifjpiao {
    public static void main(String[] args) {
        double price= calculate (12, "头等舱", 1000);
        System.out.println(price);
    }

    public static double calculate(int mothe, String type, double price) {
        if (mothe >= 5 && mothe <= 10) {
            switch (type) {
                case "头等舱":
                    price *= 0.9;
                    break;
                case "经济舱":
                    price *= 0.85;
                    break;
            }
        } else {
            switch (type) {
                case "头等舱":
                    price *= 0.7;
                    break;
                case "经济舱":
                    price *= 0.65;
                    break;
            }
        }
        return price;
    }
}